﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mime;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using LogCommon;

namespace ServerTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //捕获非UI线程未处理的异常
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            ServerControl serverControl = new ServerControl();
            serverControl.Start();
            Console.ReadKey();
        }

        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            if (e.ExceptionObject is Exception ex)
            {
                LogHelper.Fatal(ex.Message);
            }
            
        }

    }
}
